<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>18、表单属性指令-v-model-radio单选框.html</title>
</head>
<body>

<div id="app">
    <p><input type="radio" v-model="gender" value="男" id="male"><label for="male">男</label></p>
    <p><input type="radio" v-model="gender" value="女" id="female"><label for="female">女</label></p>
    <p><input type="radio" v-model="gender" value="保密" id="baomi" ><label for="baomi">保密</label></p>
    <p>你选择的元素是：{{gender}}</p>
</div>

<script src="js/vue.global.js"></script>
<script>
    var vm = Vue.createApp({
        created(){
        },
        data() {
            return {
                gender:"男"
            }
        },
        methods:{
            loginbtn(){
                var intro = this.gender;
                alert("性别是:" + gender)
            }
        }

    }).mount("#app");
</script>

</body>
</html>